package com.zbycorp.generatecode.service;

import com.intellij.database.psi.DbTable;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.zbycorp.generatecode.dto.TableInfoSettingsDTO;
import com.zbycorp.generatecode.entity.TableInfo;
import com.zbycorp.generatecode.service.impl.TableInfoSettingsServiceImpl;

/**
 * @author YCL
 * @date 2023/3/27
 */
public interface TableInfoSettingsService extends PersistentStateComponent<TableInfoSettingsDTO> {

    static TableInfoSettingsService getInstance(Project project) {
        return ServiceManager.getService(project, TableInfoSettingsServiceImpl.class);
    }

    /**
     * 获取表格信息
     *
     * @param dbTable 数据库表
     * @return {@link TableInfo}
     */
    TableInfo getTableInfo(Project project, DbTable dbTable);
}
